import { createStore, applyMiddleware } from "redux";
import rootReducer from "./reducers/root.reducer";
import createSagaMiddleware from "@redux-saga/core";
import rootSaga from "./sagas/root.saga";

// 创建saga中间件
const sagaMiddleware = createSagaMiddleware()

// 注册中间件
export const store = createStore(rootReducer, applyMiddleware(sagaMiddleware))

// 启用rootSaga
sagaMiddleware.run(rootSaga)

